<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/4/28
  Time: 14:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>文件上传</title>
</head>
<!-- 引入bootstrap -->
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
<!-- 引入JQuery  bootstrap.js-->
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.easyui.min.js"></script>
<link href="/css/zzsc.css" rel="stylesheet" type="text/css" />
<script src="/js/showlist.js" type="text/javascript"></script>
<%--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">--%>

<script src="/js/jquery.form.js" type="text/javascript"></script>
<%--<script src="/js/fileload.js" type="text/javascript"></script>--%>

<body>
<div id="content2" class="col-md-10" data-example-id="bordered-table">
    <h1 id="title1" class="text-center">图纸上传 </h1>
<form id="form1" action="/ReservePlandrawing/fileUpload" method="post" enctype="multipart/form-data">
    <input value='' type="hidden" id='getpath' name='x1' />
    <div class="center row">
    <div>
        <p>图纸名字: </p><input type="text" name="fileName" id="tuzhi">
        <p>图纸附件:</p> <input type="file" name="file">
        <p>事故类型</p>
        <select id="option1">
            <option value="1">瓦斯和煤尘爆炸</option>
            <option value="2">突然透水</option>
            <option value="3">大面积冒顶</option>
            <option value="4">井下火灾</option>
            <option value="5">矿尘危害</option>


    </select>
        <p>地点</p><input type="text" id="didian">
        <p>备注</p><input type="text" id="beizhu">
    </div>

    <div><input type="submit" value="提交图纸" /></div>
    </div>
</form>
<label id="responseText"></label>
</div>
</body>
<script type="text/javascript">
    $(function () {
        var options = {
            success: function (data) {
                var reserve_plan_title=$("#tuzhi").val()
                var remarks=$("#beizhu").val()
                var plan_id=$("#didian").val()
                var drawing_upload_filenickname=data.data
                var id=data.data
                var accident_type=$("#option1").val()

                $.ajax({
                    url:"/ReservePlandrawing/addReservePlandrawing?accident_type="+accident_type+"&id="+id+"&drawing_upload_filenickname="+id+"&plan_id="+plan_id+"&remarks="+remarks+"&reserve_plan_title="+reserve_plan_title,
                    type:"post",
                    success:function () {
                        alert("上传成功")

                        window.location.href="/plan/drawing"

                    },
                    error: function a() {
                        alert("上传失败")
                    }
                })



            }
        };
        $("#form1").ajaxForm(options);

    });
</script>

</html>
